//
//  PlayListTableViewCell.m
//  瓜子电台
//
//  Created by lanou on 16/8/10.
//  Copyright © 2016年 YueZhang. All rights reserved.
//

#import "PlayListTableViewCell.h"

@implementation PlayListTableViewCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setDataWithModel:(PlayListModel *)model
{
    [self.pic sd_setImageWithURL:[NSURL URLWithString:model.coverLarge] placeholderImage:[UIImage imageNamed:@"picPlaceHolder"]];
    self.pic.layer.cornerRadius = self.pic.ownWidth / 2;
    self.pic.clipsToBounds = YES;
    self.pic.layer.borderColor = [UIColor lightGrayColor].CGColor;
    self.pic.layer.borderWidth = 1.5f;
    
    self.title.text = model.title;
    
    float a = (CGFloat)model.playtimes / 10000;
    char buf[10];
    sprintf(buf, "%.1f", a);
    sscanf(buf, "%f", &a);
    NSString *str = [NSString stringWithFormat:@"%s万", buf];
    self.playCount.text = str;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
